#pragma once

#include <string>

#include <refbase.h>

struct Message {
    int id;
    std::string message;
};

class MySocketClient : public RefBase {
public:
    static sptr<MySocketClient> GetInstance();

    int Connect(std::string addr, uint16_t port);
    void Send(const struct Message &m);
    std::string Recv();
    void Disconnect();

private:
    MySocketClient() = default;
    virtual ~MySocketClient() = default;
    static inline sptr<MySocketClient> instance = nullptr;

    int socketFd = -1;
};
